package com.shabox.alopaydemo.config;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AliSDK {

    private String URL = "https://openapi.alipaydev.com/gateway.do";

    private String  APP_ID = "**";

    private String APP_PRIVATE_KEY = "***";

    private String FORMAT = "json";

    public static String CHARSET = "UTF-8";

    public static String ALIPAY_PUBLIC_KEY = "***";

    public static String SIGN_TYPE = "RSA2";
    @Bean
    public AlipayClient alipayClient(){
        AlipayClient alipayClient = new DefaultAlipayClient(URL, APP_ID, APP_PRIVATE_KEY, FORMAT, CHARSET, ALIPAY_PUBLIC_KEY, SIGN_TYPE);
        return alipayClient;
    }
}
